1. Technology Field
The invention generally relates to a data writing method, and more particularly, to a method for backing up data when the data is written, and a memory storage device and a memory controller using the same.
2. Description of Related Art
Rewritable non-volatile memory is broadly applied in various electronic devices due to its characteristics such as data non-volatility, low power consumption, small volume, and non-mechanical structure. Solid state drive (SSD) is a storage device which uses rewritable non-volatile memory as its storage medium and is becoming more and more focused by consumers because of its many advantages.
A rewritable non-volatile memory has a plurality of physical blocks, and each of the physical blocks has a plurality of physical pages. Physical block is the smallest unit for erasing data, while physical page is the smallest unit for writing data. A memory management circuit of a storage device converts a logical access address to be accessed by a host system into a corresponding logical page and accesses a physical page corresponding to the logical page.
Error bits may be produced in data stored in a rewritable non-volatile memory due to various factors (for example, electric leakage of memory cells, program failure, and so on). Thus, an error checking and correcting (ECC) circuit is usually disposed in a storage device to ensure the accuracy of data. When a host system is about to read data from a SSD, because the data may be a crucial boot file or system file, the data cannot be directly sent back to the host system if the number of error bits in the data exceeds the number of error bits that can be corrected by the ECC circuit. Instead, the host system is notified about the data error so that the operating system in the host system will to correct the error.
Generally speaking, when data is read according to a read command received from the host system, a logical access address corresponding to the data can be identified according to the read command, and accordingly, the host system can be correctly responded when a data error is detected. However, if a data error is detected when a SSD is restarted and the physical pages are scanned, the logical access address corresponding to the data in a physical page cannot be determined based on the information recorded in the physical page. Thus, if subsequently the host system is about to read the logical access address and the host system is not correctly notified about the data error, problems may be caused in the operation of the operating system of the host system.
Nothing herein should be construed as an admission of knowledge in the prior art of any portion of the present invention. Furthermore, citation or identification of any document in this application is not an admission that such document is available as prior art to the present invention, or that any reference forms a part of the common general knowledge in the art.